#pragma once
#include "ElementNode.h"
#include "math.h"
#include "grid3x3.h"
namespace NBGUI
{
	class GUIAPI Subtab: public ElementNode, public Grid3x3
	{
	public:
		enum SubTabState
		{
			Check = 0,
			Uncheck,
		};

		Subtab(GUIDrawer* drawer, const char* name, const char* eleText, int _id, int eleType = NONE, Rect& _rect = Rect() );
		Subtab(GUIDrawer* drawer, const char* name, const char* eleText, int _id, vec2f* uv, int eleType = NONE, Rect& _rect = Rect() );
		~Subtab();

		void buildVI(std::vector<Vertex>* vertices, std::vector<unsigned int>* indices,unsigned int screenWidth, unsigned int screenHeight);

		void draw();
		void handleEvent(Event* e);
		inline int getState(){return state;}
		inline int getId(){return id;}
	protected:
		vec2f uv[8];
		int state;
		int highLight;
		int id;//id in the father tab
	};
}